package com.cykj.admin.controller;

import com.cykj.admin.annotation.MyLog;
import com.cykj.admin.service.IJobService;
import com.cykj.admin.vo.JobVO;
import com.cykj.common.dto.ResponseDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject:@BelonqsPackage:com.cykj.admin.controller
 * @Author:jiangna
 * @CreateTime:2025-08-21 10:00
 */
@Tag(name = "JobController",description = "平台端职位管理的接口")
@RestController
@RequestMapping("job")
public class JobController {

    @Autowired
    private IJobService jobService;

    /**
    * @Description: 查询所有职位的信息/根据职位、类别、状态查询所有信息
    * @Param: [jobVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @Operation(summary = "平台端查询所有职位的信息接口")
    @GetMapping("selectByJob")
    public ResponseDTO selectByJob(JobVO jobVO) {
        return jobService.selectByJob(jobVO);
    }

    /**
    * @Description: 修改职位的信息
    * @Param: [jobVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("修改职位信息")
    @Operation(summary = "平台端修改职位的信息接口")
    @PutMapping("updateByJob")
    public ResponseDTO updateByJob(JobVO jobVO) {
        return jobService.updateByJob(jobVO);
    }

    /**
    * @Description: 添加职位
    * @Param: [jobVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("添加职位")
    @Operation(summary = "平台端添加职位信息接口")
    @PostMapping("addByJob")
    public ResponseDTO addByJob(JobVO jobVO) {
        return jobService.addByJob(jobVO);
    }

    /**
    * @Description: 拉黑该职位
    * @Param: [jobVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("拉黑职位")
    @Operation(summary = "平台端拉黑该职位接口")
    @DeleteMapping("/deleteJob")
    public ResponseDTO deleteJob(JobVO jobVO) {
        return jobService.deleteJob(jobVO);
    }

}
